-- activity_wear_gem
-- create by cheny3
-- 首次穿戴奖励钻石

return {
    apply = function(prop, baseValue)
        -- 数量
        return prop[3];
    end,

    -- 穿戴装备触发
    trigger = function(who, prop, classId)
        if who.type ~= OBJECT_TYPE_USER then
            return;
        end

        local key = prop[2];
        local v = prop[3];

        -- 一次活动一次
        if BuildingBonusM.getFieldStat(key) >= 1 then
            return;
        end

        BuildingBonusM.addFieldStat(key, 1);

        local bonus = {2, "gem", v, };
        BonusM.doBonus(bonus, "activity_wear_gem");

        -- 奖励事件
        EventMgr.fire(event.SKILL_BONUS, { ["bonus"] = bonus});
    end,

    record = function(target, prop, path)
        return false;
    end,
};
